<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<h:head>
	<title>Travel Dream</title>
</h:head>

<h:body>

	<h1>Travel Dream</h1>
	<h:outputText value="Hello #{userBean.getName()} !" />
	<br/>
	<a href="../logoutRedirect.xhtml" style="background-image: image/logout_button.png">Logout</a>                
 
	

<div class = "list">
<h1>Customer List</h1>
<h:form id="form">  
     <p:growl id="msgs" showDetail="true" />  
    <p:dataTable id="users" var="user" value="#{userListBean.getModel()}">  
        <p:column headerText="Name">  
            <h:outputText value="#{user.name}" />  
        </p:column>  
  
        <p:column headerText="Surname">  
            <h:outputText value="#{user.surname}" />  
        </p:column> 
        
        <p:column headerText="Username">  
            <h:outputText value="#{user.username}" />  
        </p:column> 
        
        <p:column style="width:4%">  
                <p:commandButton id="selectButton" actionListener="#{userListBean.addEmployee(user)}" value="Upgrade to employee" title="View" update=":form:msgs"> 

      			<f:setPropertyActionListener value="#{user}" target="#{userListBean.selectedUser}" />  
            </p:commandButton>   

        </p:column>  
        
  
    </p:dataTable>  
</h:form>  

<br/>

   </div>                   


</h:body>
 
</html>
